package net.mikoo.seals.agent.common;
import java.io.Serializable;
import java.util.Date;

/**
 * @author huangxm
 * 
 */
public class BaseModel implements Serializable {
	
	private static final long serialVersionUID = 4979850426150980383L;

	//批量操作索引值 
	private Integer index;
	
	private Date createTime = new Date();

	private Date updateTime;
	
	private int offset = 0;
	
	private int pageSize =30;

	/**
	 * 
	 */
	public BaseModel() {
	}

	

	public Date getCreateTime() {
		return createTime;
	}



	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}





	public Date getUpdateTime() {
		return updateTime;
	}





	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}





	public int getOffset() {
		
		if(offset <= 0){
			
			Integer currentPage = WebContext.getPage();
			if(currentPage== null){
				currentPage = 1;
			}
			offset = (currentPage -1) * pageSize;
		}
		
		
		return offset;
	}

	public void setOffset(int offset) {
		this.offset = offset;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getIndex() {
		return index;
	}

	public void setIndex(Integer index) {
		this.index = index;
	}


}
